/**
 * @module      index.js
 * @author      nayoayo
 * @date        2021/7/8 10:42 上午
 * @version     1.0
 */

import MdFormModal from '../src/components/MdFormModule';
import MdFormModalItem from '../src/components/MdFormModuleItem';
import {stepForm} from '../src/common/config';

const components = [
    MdFormModal,
    MdFormModalItem
];

const install = function (vue, options) {
    if (install.installed) return;
    if (options) stepForm(options);
    components.map(component => vue.component(component.name, component));
};

// 判断是否是直接引入文件
if (typeof window !== 'undefined' && window.Vue) {
    install(window.Vue);
}

export default {
    install,
    MdFormModal,
    MdFormModalItem
};
